package com.knife.lov.infra.aspect;

import com.knife.lov.infra.annotations.KnifeProcessLovValue;
import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.stereotype.Component;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

/**
 * @author tianhao.luo@hand-china.com
 * @version 1.0
 * @date 2022年04月16日 星期六 12:47 上午
 * @description
 * @since 1.0
 */
@Component
public class KnifeLovProcessPointcut extends StaticMethodMatcherPointcut {
    @Override
    public boolean matches(Method method, Class<?> aClass) {
        Annotation annotation = method.getAnnotation(KnifeProcessLovValue.class);
        return annotation !=null;
    }
}
